home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / dmorf012.zip / DMORF.DOC next >
Text File  |  1992-12-27  |  8KB  |  192 lines

  1. DMORF Rel Alpha 0.12 (12/26/92)
  2. Copyright (c) 1992, by David K. Mason
  3.  
  4. This is just a brief intro to get you going with DMorf.  It's not
  5. a real document or anything.
  6.  
  7. To run DMorf, you MUST have:
  8.  1) A VGA monitor (regular VGA is sufficient... DMorf works only
  9.     in 640x480x16 mode)
  10.  2) At least a '286
  11.  3) A mouse with a microsoft-compatible driver
  12.  
  13. To accomplish any serious work with this program, you SHOULD have:
  14.  
  15.  1) A numeric coprocessor... it DRAGS without one
  16.  
  17.  2) Plenty of XMS (EMS is not useful) unless you're working with
  18.     teeny pictures.
  19.     During the warping process, DMorf creates a buffer
  20.     big enough to hold one entire picture, in RGBa (32-bit)
  21.     form.  That means 256000 bytes if you're working with
  22.     320x200 pictures, or 1,228,800 for 640x480, or 1,920,000
  23.     for 800x600, or 3,145,728 for 1024x768.
  24.  
  25.     (Note: there are two versions of dmorf in the package...
  26.      dmorf.exe, which runs in real mode and only allows access
  27.      to conventional memory, and dmorfx.exe, which runs
  28.      in 286 protected mode, and allows access to up to 16M
  29.      of extended memory... dmorfx requires some extra files
  30.      that are not included in this archive... they're
  31.      called "DPMI16BI.OVL" and "RTM.EXE", and they're in another
  32.      archive file called "DTAMEM.ZIP" which you should be able
  33.      to find in the same place you found Dmorf.)
  34.  
  35. To get started with DMorf, type "DMORF <file1> <file2>"
  36. (or "DMORFX <file1> <file2>" if you're using the protected mode
  37. version).
  38. The files can be TGA (16, 24, or 32, compressed or uncompressed),
  39. Vivid IMG, or GIF.  The two files don't have to be in the same
  40. format, but they do have to have the same dimensions.
  41. DMorf doesn't currently check to make sure they have the same
  42. dimensions, so if you mix 'em up, you might get REAL odd results,
  43. run-time error, or both.
  44.  
  45. The only type of output DMorf creates is compressed Targa-32
  46. files.  VPIC and PICLAB have some trouble reading the output files,
  47. because the run-length packets span lines.
  48. DTA can read 'em okay, though.
  49.  
  50. DMorf will then read and display the two pictures in side-by-side
  51. windows.  If you only gave one filename, then it'll display
  52. that picture twice.
  53. It scales 'em so they'll fit in the windows.
  54.  
  55. Then, a mesh is laid over the two pictures.
  56. In this program, a mesh is represented by a bunch of horizontal
  57. and vertical lines.  The points where they intersect can be
  58. adjusted.
  59. Initially, there are lines on the four edges of the picture,
  60.  
  61. There are always the same number of mesh points defined in the
  62. two pictures, though they aren't always in the same places
  63. unless the meshes are locked.
  64.  
  65. To add a new line to the mesh, move the mouse cursor to the
  66. border around one of the pictures (which one doesn't particularly
  67. matter).  Click the button at the point where you want the line
  68. added.  (If the cursor is on the top or bottom border, a vertical
  69. line will be added, and if it's on one of the sides, a horizontal
  70. line will be added.)
  71.  
  72. To move a vertex, put the mouse cursor over the intersection
  73. of two lines, press the button, and move the mouse.
  74. Let go of the button when you've got the point where you want
  75. it.  DMorf will try to prevent you from overlapping lines.
  76. It's possible to defeat it with weird angles.  It's best if
  77. you don't, however.
  78.  
  79. Here's what the other controls on the screen do:
  80.  
  81.  Just Warp:  In Morph mode, the program will map points from
  82.    picture #1 toward picture #2, and from 2 toward 1, and
  83.    cross-fade.  In Warp mode, it'll just map points from
  84.    #1 toward #2, with no fade.
  85.    Not too surprisingly, Warp mode takes half the time
  86.    that Morph mode does.
  87.  
  88.  Spline meshes:
  89.    When your points are all located where you want them to be,
  90.    and you tell DMorf to go ahead and morph, DMorf figures out
  91.    which points to map where by drawing spine curves between
  92.    the vertices.
  93.    If you turn this control off, it'll draw straight lines instead.
  94.    Reasons to use slines instead of lines: the warp often looks
  95.    a whole lot better.
  96.    Reasons to use lines instead of splines:
  97.    (1) Splines sometimes go haywire, with curves going every which
  98.        way, overlapping, and (gasp) sometimes even passing beyond
  99.        of the picture borders
  100.    (2) You don't want something curved when it warps
  101.    (3) lines are faster than splines.
  102.  
  103.  Smooth resampling:  In smooth mode, DMorf interpolates
  104.    new pixel values from all source pixels that should
  105.    contribute... if you turn this control off, it just
  106.    grabs a the closest pixel value.
  107.    Nearest neighbor, in other words.  The results
  108.    in smooth mode look massively better than dumb mode.
  109.    But dumb mode is massively faster.  Dumb mode would be
  110.    useful in test runs, but don't use it for real stuff, 'cause
  111.    it looks like crap.
  112.  
  113.  The Mesh colors "R" control: sets the red component of the color
  114.    used to display the control mesh.
  115.  
  116.  The Mesh colors "G" control: sets the green component of the color
  117.    used to display the control mesh.
  118.  
  119.  The Mesh colors "B" control: sets the blue component of the color
  120.    used to display the control mesh.
  121.  
  122.  The Frames control: tells DMorf how many pictures to create.
  123.    If you're in Morph mode, then this represents how many tween
  124.    frames to create.  In warp mode, this number includes a
  125.    fully-warped final frame.
  126.  
  127.  The Swap button: swaps the meshes between the two windows.
  128.  
  129.  The Copy 1->2 button: copies the mesh from window 1 into
  130.    window 2.
  131.  
  132.  The Copy 2->1 button: copies the mesh from window 2 into
  133.    window 1.
  134.  
  135.  The Splines button: gives you a preview of what splines for the
  136.    current mesh points would look like.  If you're using
  137.    "Spline meshes" mode, make sure you use this button once in a
  138.    while to make sure the splines aren't going nuts.
  139.  
  140.  The Zoom buttons: display just one of the images, much larger.
  141.    This gives much finer control over the mesh control points.
  142.  
  143.  The Save button: saves your meshes and settings to a control file.
  144.  
  145.  The Load button: loads a control file.  Type the filename right the
  146.    first time or you'll get a run-time error and get dumped out to
  147.    DOS.
  148.  
  149.  The Go button: causes DMorf to start morphing.
  150.  
  151.  The Abort button: Changed my mind.  Get me out of this program NOW.
  152.    The escape key does the same thing.
  153.  
  154. If all this makes no sense, just start messing around with the
  155. program.  Once you figure out how to add new points to the mesh,
  156. the rest of the interface is pretty intuitive.
  157.  
  158. Credits:
  159.  
  160. The warping and morphing algorithms come from George
  161. Wolberg's book Digital Image Warping.
  162. The image scaling and spline code come virtually unchanged from the
  163. same book (except for translating it from C to Pascal).
  164. I ripped the line drawing routines off from PC Magazine's
  165. book Turbo Pascal 6.0 Techniques and Utilities, by Neil Rubenking.
  166. I don't remember what other places I stole stuff from.
  167. Much is actually my original work, though.
  168. Thanks to the Compuserve GRAPHDEV forum gang, and the Graphics
  169. Alternative BBS gang for their suggestions, and various bugs
  170. they've helped me identify.
  171.  
  172. Stuff I'm going to add or change (sooner or later):
  173.  
  174. 1) Deletion of mesh lines.
  175. 2) A better way of adding mesh lines.
  176. 3) Proper handling of the alpha channel.  Right now DMorf takes
  177.    the alpha byte from TGA-32s into account, but I haven't
  178.    bothered to make it work with them right.
  179.    Since I don't actually have any test files with real alpha
  180.    info in them.
  181.    I'm also going to have to write a little program to add alpha
  182.    info to pictures (a seed fill to alpha out the background
  183.    is a method suggested in Foley & Van Dam).
  184.    And write a program to do compositing (or add that capability
  185.    to DTA).
  186. 4) Or, forget that alpha stuff and add some kind of mechanism for
  187.    cropping out the background.
  188.  
  189. -- David K. Mason
  190.    P.O. Box 181015
  191.    Boston, MA 02118
  192.